package com.fuego.creditsystemnews.controller;


import org.example.dto.Result;
import com.fuego.creditsystemnews.service.IFollowService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;



@RestController
@RequestMapping("/follow")
public class FollowController {
    @Resource
    private IFollowService followService;
    @PostMapping("/{id}/{isFollow}")
    public Result follow(@PathVariable("id") Long followUserId,@PathVariable("isFollow") Boolean isFollow , @RequestParam("userId") Long userId){
        return followService.follow(followUserId,isFollow,userId);
    }

    @GetMapping("/or/not/{id}")
    public Result isfollow(@PathVariable("id") Long followUserId , @RequestParam("userId") Long userId){
        return followService.isFollow(followUserId,userId);
    }


    @GetMapping("/common/{id}")
    public Result followCommons(@PathVariable("id") Long id , @RequestParam("userId") Long userId){
        return followService.followCommons(id,userId);
    }

}
